package chapter_20_memento.classic_white_box;

/**
 * @author yaochenglong
 * @date 2017/10/24
 *
 * 发起人对象
 */
public class Originator {

    private String state="";

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento createMemento(){
        return new Memento(this.state);
    }

    public void restoreState(Memento memento){
        this.state = memento.getState();
    }
}
